<template xmlns:v-clipboard="http://www.w3.org/1999/xhtml">
    <div>
      <el-row :gutter="20">
        <el-col :span="6"><el-input
          placeholder="请输入内容"
          v-model="value">
        </el-input></el-col>
        <el-col :span="2">
          <el-button type="primary" v-clipboard="value"
                     v-clipboard:success="clipboardSuccessHandler"
                     v-clipboard:error="clipboardErrorHandler">复制</el-button>
        </el-col>
      </el-row>
    </div>
</template>

<script>
    export default {
        name: "Test1",
      data() {
        return {
          value:'2659100297@qq.com'
        }
      },
      methods: {
        // Success event handler
        clipboardSuccessHandler ({ value, event }){
          console.log('success', value);
          this.$message.success("已复制");
        },
        // Error event handler
        clipboardErrorHandler ({ value, event }) {
          console.log('error', value)
        }
      }

    }
</script>

<style scoped>

</style>
